﻿/*-----------------------------------------------
// File: Response.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace Battle.View
{
    public class ResponseBase {
        public OnceAttackPackageBase packageData;
        public virtual string GetDesc() { return ""; }
    }

    public class ProjectileResponse : ResponseBase {
        public string sourceUid;
        public SkillType skillType;
        public string releaseId;
        public int FPId;
        public BattleCamp FPCamp;
        public ProjectileResponse(ProtoBuf.Message.SCShootProj msg) {
            sourceUid = msg.actorUid;
            skillType = (SkillType)msg.releaseSkillType;
            releaseId = msg.releaseId;
            FPId = msg.FPId;
            FPCamp = BattleViewCtrl.GetInstance().GetCamp(msg.FPFighterUid);
            packageData = null;
        }
        public ProjectileResponse(ProtoBuf.Message.SCShoot msg) {
            sourceUid = msg.actorUid;
            skillType = (SkillType)msg.releaseSkillType;
            releaseId = msg.releaseId;
            FPId = msg.FPId;
            FPCamp = (BattleCamp)msg.targetCamp;
            packageData = null;
        }
        public override string GetDesc()
        {
            return "[ProjectileResponse] Source: " + sourceUid + " SkillType:" + skillType + " ReleaseId:" + releaseId + " TargetFPId:" + FPId + " TargetCamp:" + FPCamp;
        }

    }

    public class AttackResponse : ResponseBase {
        public string sourceUid;
        public SkillType skillType;
        public string releaseId;

        public AttackResponse(ProtoBuf.Message.SkillOnceCast onceCast) {
            sourceUid = onceCast.sourceUid;
            skillType = (SkillType)onceCast.skillType;
            releaseId = onceCast.releaseId;
            packageData = new OnceAttackPackage(onceCast);
        }
        public override string GetDesc()
        {
            return "[AttackResponse] Source:" + sourceUid + " SkillType:" + skillType + " ReleaseId:" + releaseId; 
        }
    }

}